<template>
    <div>
<h3>详情</h3>
<table class="table table-bordered">
            <tbody>
                <tr>
                    <td>房型名称</td>
                    <td>{{a.HouseTypeName}}</td>
                </tr>
                <tr>
                    <td>图片</td>
                    <td>
                        <img :src="a.Photo" width="200"/>
                    </td>
                </tr>
                <tr>
                    <td>面积</td>
                    <td>{{a.Area}}㎡</td>
                </tr>
                <tr>
                    <td>是否有窗户</td>
                    <td>{{a.IsWindow==1?"有":"没有"}}
                    </td>
                </tr>
                <tr>
                    <td>可住人数</td>
                    <td>{{a.Count}}人</td>
                </tr>
                <tr>
                    <td>价格</td>
                    <td>{{a.Price}}￥</td>
                </tr>
                <tr>
                    <td>状态</td>
                    <td>{{a.State==1?"发布":"没发布"}}
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td><input type="button" value="返回" @click="ok"></td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import axios from 'axios';
import moment from 'moment';
const router = useRouter();
const route = useRoute();

onMounted(()=>{
    getdata();
})
let a: any = reactive({
    HouseTypeName: '',
    Photo: '',
    Area: '',
    IsWindow: '',
    Count: '',
    Price: '',
    State: '',

})
const ok:any=()=>{
    router.push("/houseshow")
}
const getdata:any=()=>{
   axios({
     url:'/api/HouseType/GetHouseType',
     method:'get',
     params:{id:route.query.id}
   })
   .then((res)=>{
    console.log(res)
    Object.assign(a,res.data)
   })
}




</script>

<style scoped>

</style>